<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>FF</title>
<link rel='stylesheet' type='text/css'
	href='${pageContext.request.contextPath}/resources/foundation-5.2.0/css/foundation.css'></link>
<link rel='stylesheet' type='text/css'
	href='${pageContext.request.contextPath}/resources/custom.css'></link>
<style type="javascript">

</style>
</head>
<body>
	<script type="text/javascript">
	var performances = ${performances}
	var awayPerformances = ${awayPerformances}
	var homePerformances = ${homePerformances}
	</script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/resources/angular.min.js"></script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/resources/view/app.js"></script>
	<div ng-app="myApp" ng-controller="TeamCtrl">
		<table style="width: 100%;">
			<tr>
				<td class="text-center" colspan="2"><a href=""
					ng-click="orderByField='points';  venues='home';"
					ng-style="venues === 'home' && {'font-size': '120%'}">Home</a></td>
				<td class="text-center" colspan="15"><a href=""
					ng-click="orderByField='points';  venues='overall';"
					ng-style="venues === 'overall' && {'font-size': '120%'}">Overall</a></td>
				<td class="text-center" colspan="2"><a href=""
					ng-click="orderByField='points';  venues='away';"
					ng-style="venues === 'away' && {'font-size': '120%'}">Away</a></td>
			</tr>
		</table>
		<table style="width: 100%;" ng-show="venues == 'overall'">

			<tr>
				<th><a href=""
					ng-click="orderByField='player.name'; reverseSort = !reverseSort">Name</th>
				<th><a href=""
					ng-click="orderByField='gamePlayed'; reverseSort = !reverseSort">Played</th>
				<th><a href=""
					ng-click="orderByField='points'; reverseSort = !reverseSort">Points</a></th>
				<th><a href=""
					ng-click="orderByField='goals'; reverseSort = !reverseSort">Goals</a></th>
				<th><a href=""
					ng-click="orderByField='assists'; reverseSort = !reverseSort">Assists</a></th>
				<th><a href=""
					ng-click="orderByField='foulsWon'; reverseSort = !reverseSort">Fouls
						Won</a></th>
				<th><a href=""
					ng-click="orderByField='foulsCommitted'; reverseSort = !reverseSort">Fouls
						Committed</a></th>
				<th><a href=""
					ng-click="orderByField='blockedShots'; reverseSort = !reverseSort">Blocked
						Shots</a></th>
				<th><a href=""
					ng-click="orderByField='shotsOnTarget'; reverseSort = !reverseSort">Shots</a></th>
				<th><a href=""
					ng-click="orderByField='passesIntercepted'; reverseSort = !reverseSort">Intercepted</a></th>
				<th><a href=""
					ng-click="orderByField='crosses'; reverseSort = !reverseSort">Crosses</a></th>
				<th><a href=""
					ng-click="orderByField='setPieceGoals'; reverseSort = !reverseSort">Set
						Piece Goals</a></th>
				<th><a href=""
					ng-click="orderByField='goalsAllowed'; reverseSort = !reverseSort">Allowed
						Goals</a></th>
				<th><a href=""
					ng-click="orderByField='cleanSheets'; reverseSort = !reverseSort">Clean
						Sheets</a></th>
				<th><a href=""
					ng-click="orderByField='saves'; reverseSort = !reverseSort">Saves</a></th>
				<th><a href=""
					ng-click="orderByField='win'; reverseSort = !reverseSort">Wins</a></th>
				<th><a href=""
					ng-click="orderByField='tie'; reverseSort = !reverseSort">Ties</a></th>
				<th><a href=""
					ng-click="orderByField='defeat'; reverseSort = !reverseSort">Defeats</a></th>
				<th><a href=""
					ng-click="orderByField='foulsWonCommittedRatio'; reverseSort = !reverseSort">Fouls
						W/C</a></th>
				<th><a href=""
					ng-click="orderByField='averagePoints'; reverseSort = !reverseSort">Avg.
						Points</a></th>

			</tr>
			<tr
				ng-repeat="performance in teamPerformances.data|orderBy:orderByField:!reverseSort|emptyToEnd:orderByField">

				<td><a
					href="${pageContext.request.contextPath}/player/{{performance.player.id}}">{{performance.player.name}}</td>
				<td>{{performance.gamePlayed}}</td>
				<td>{{performance.points}}</td>
				<td>{{performance.goals}}</td>
				<td>{{performance.assists}}</td>
				<td>{{performance.foulsWon}}</td>
				<td>{{performance.foulsCommitted}}</td>
				<td>{{performance.blockedShots}}</td>
				<td>{{performance.shotsOnTarget}}</td>
				<td>{{performance.passesIntercepted}}</td>
				<td>{{performance.crosses}}</td>
				<td>{{performance.setPieceGoals}}</td>
				<td>{{performance.goalsAllowed}}</td>
				<td>{{performance.cleanSheets}}</td>
				<td>{{performance.saves}}</td>
				<td>{{performance.win}}</td>
				<td>{{performance.tie}}</td>
				<td>{{performance.defeat}}</td>
				<td>{{performance.foulsWonCommittedRatio| number:2}}</td>
				<td>{{performance.averagePoints| number:2}}</td>

			</tr>
		</table>
		<table style="width: 100%;" ng-show="venues == 'home'">
			<tr>
				<th><a href=""
					ng-click="orderByField='player.name'; reverseSort = !reverseSort">Name</th>
				<th><a href=""
					ng-click="orderByField='gamePlayed'; reverseSort = !reverseSort">Played</th>
				<th><a href=""
					ng-click="orderByField='points'; reverseSort = !reverseSort">Points</a></th>
				<th><a href=""
					ng-click="orderByField='goals'; reverseSort = !reverseSort">Goals</a></th>
				<th><a href=""
					ng-click="orderByField='assists'; reverseSort = !reverseSort">Assists</a></th>
				<th><a href=""
					ng-click="orderByField='foulsWon'; reverseSort = !reverseSort">Fouls
						Won</a></th>
				<th><a href=""
					ng-click="orderByField='foulsCommitted'; reverseSort = !reverseSort">Fouls
						committed</a></th>
				<th><a href=""
					ng-click="orderByField='blockedShots'; reverseSort = !reverseSort">Blocked
						Shots</a></th>
				<th><a href=""
					ng-click="orderByField='shotsOnTarget'; reverseSort = !reverseSort">Shots</a></th>
				<th><a href=""
					ng-click="orderByField='passesIntercepted'; reverseSort = !reverseSort">Intercepted</a></th>
				<th><a href=""
					ng-click="orderByField='crosses'; reverseSort = !reverseSort">Crosses</a></th>
				<th><a href=""
					ng-click="orderByField='setPieceGoals'; reverseSort = !reverseSort">Set
						Piece Goals</a></th>
				<th><a href=""
					ng-click="orderByField='goalsAllowed'; reverseSort = !reverseSort">Allowed
						Goals</a></th>
				<th><a href=""
					ng-click="orderByField='cleanSheets'; reverseSort = !reverseSort">Clean
						Sheets</a></th>
				<th><a href=""
					ng-click="orderByField='saves'; reverseSort = !reverseSort">Saves</a></th>
				<th><a href=""
					ng-click="orderByField='win'; reverseSort = !reverseSort">Wins</a></th>
				<th><a href=""
					ng-click="orderByField='tie'; reverseSort = !reverseSort">Ties</a></th>
				<th><a href=""
					ng-click="orderByField='defeat'; reverseSort = !reverseSort">Defeats</a></th>
				<th><a href=""
					ng-click="orderByField='foulsWonCommittedRatio'; reverseSort = !reverseSort">Fouls
						W/C</a></th>
				<th><a href=""
					ng-click="orderByField='averagePoints'; reverseSort = !reverseSort">Avg.
						Points</a></th>

			</tr>
			<tr
				ng-repeat="performance in teamPerformances.home|orderBy:orderByField:!reverseSort|emptyToEnd:orderByField">

				<td>{{performance.player.name}}</td>
				<td>{{performance.gamePlayed}}</td>
				<td>{{performance.points}}</td>
				<td>{{performance.goals}}</td>
				<td>{{performance.assists}}</td>
				<td>{{performance.foulsWon}}</td>
				<td>{{performance.foulsCommitted}}</td>
				<td>{{performance.blockedShots}}</td>
				<td>{{performance.shotsOnTarget}}</td>
				<td>{{performance.passesIntercepted}}</td>
				<td>{{performance.crosses}}</td>
				<td>{{performance.setPieceGoals}}</td>
				<td>{{performance.goalsAllowed}}</td>
				<td>{{performance.cleanSheets}}</td>
				<td>{{performance.saves}}</td>
				<td>{{performance.win}}</td>
				<td>{{performance.tie}}</td>
				<td>{{performance.defeat}}</td>
				<td>{{performance.foulsWonCommittedRatio| number:2}}</td>
				<td>{{performance.averagePoints| number:2}}</td>
			</tr>
		</table>
		<table style="width: 100%;" ng-show="venues == 'away'">

			<tr>
				<th><a href=""
					ng-click="orderByField='player.name'; reverseSort = !reverseSort">Name</th>
				<th><a href=""
					ng-click="orderByField='gamePlayed'; reverseSort = !reverseSort">Played</th>
				<th><a href=""
					ng-click="orderByField='points'; reverseSort = !reverseSort">Points</a></th>
				<th><a href=""
					ng-click="orderByField='goals'; reverseSort = !reverseSort">Goals</a></th>
				<th><a href=""
					ng-click="orderByField='assists'; reverseSort = !reverseSort">Assists</a></th>
				<th><a href=""
					ng-click="orderByField='foulsWon'; reverseSort = !reverseSort">Fouls
						Won</a></th>
				<th><a href=""
					ng-click="orderByField='foulsCommitted'; reverseSort = !reverseSort">Fouls
						committed</a></th>
				<th><a href=""
					ng-click="orderByField='blockedShots'; reverseSort = !reverseSort">Blocked
						Shots</a></th>
				<th><a href=""
					ng-click="orderByField='shotsOnTarget'; reverseSort = !reverseSort">Shots</a></th>
				<th><a href=""
					ng-click="orderByField='passesIntercepted'; reverseSort = !reverseSort">Intercepted</a></th>
				<th><a href=""
					ng-click="orderByField='crosses'; reverseSort = !reverseSort">Crosses</a></th>
				<th><a href=""
					ng-click="orderByField='setPieceGoals'; reverseSort = !reverseSort">Set
						Piece Goals</a></th>
				<th><a href=""
					ng-click="orderByField='goalsAllowed'; reverseSort = !reverseSort">Allowed
						Goals</a></th>
				<th><a href=""
					ng-click="orderByField='cleanSheets'; reverseSort = !reverseSort">Clean
						Sheets</a></th>
				<th><a href=""
					ng-click="orderByField='saves'; reverseSort = !reverseSort">Saves</a></th>
				<th><a href=""
					ng-click="orderByField='win'; reverseSort = !reverseSort">Wins</a></th>
				<th><a href=""
					ng-click="orderByField='tie'; reverseSort = !reverseSort">Ties</a></th>
				<th><a href=""
					ng-click="orderByField='defeat'; reverseSort = !reverseSort">Defeats</a></th>
				<th><a href=""
					ng-click="orderByField='foulsWonCommittedRatio'; reverseSort = !reverseSort">Fouls
						W/C</a></th>
				<th><a href=""
					ng-click="orderByField='averagePoints'; reverseSort = !reverseSort">Avg.
						Points</a></th>

			</tr>
			<tr
				ng-repeat="performance in teamPerformances.away|orderBy:orderByField:!reverseSort|emptyToEnd:orderByField">

				<td>{{performance.player.name}}</td>
				<td>{{performance.gamePlayed}}</td>
				<td>{{performance.points}}</td>
				<td>{{performance.goals}}</td>
				<td>{{performance.assists}}</td>
				<td>{{performance.foulsWon}}</td>
				<td>{{performance.foulsCommitted}}</td>
				<td>{{performance.blockedShots}}</td>
				<td>{{performance.shotsOnTarget}}</td>
				<td>{{performance.passesIntercepted}}</td>
				<td>{{performance.crosses}}</td>
				<td>{{performance.setPieceGoals}}</td>
				<td>{{performance.goalsAllowed}}</td>
				<td>{{performance.cleanSheets}}</td>
				<td>{{performance.saves}}</td>
				<td>{{performance.win}}</td>
				<td>{{performance.tie}}</td>
				<td>{{performance.defeat}}</td>
				<td>{{performance.foulsWonCommittedRatio| number:2}}</td>
				<td>{{performance.averagePoints| number:2}}</td>

			</tr>
		</table>
	</div>

</body>
</html>